import { get, dele, post } from "../utils/request";

//获取用户购物车数据
export const getCartdate = () => get("/api/v1/shop_carts");

//添加购物车
export const addTocart = (product, value = 1) =>
  post("/api/v1/shop_carts", {
    product, //商品id
    quantity: value,
  });

//删除购物车信息
export const delCartdate = (id) => dele("/api/v1/shop_carts/" + id);

//删除多个购物车记录

// export const delmanyCart = (data) => post("/api/v1/shop_carts/delmany", data);

export const delmanyCart = (ids) => post("/api/v1/shop_carts/delmany", ids);


//订单提交
export const addorder = (data) => post("/api/v1/orders", data);
//  提交订单
export const addOrderAPI = (data) => post("/api/v1/orders", data);

//获取收货地址列表
export const getAddress = () => get("/api/v1/addresses");
